﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="View.aspx.cs" Inherits="CustomerContactSystem.WebForms.Enquiries.View" %>
<%@ Import Namespace="CustomerContactSystem.Core.Infrastructure.Utility" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Enquiry: <asp:Label ID="EnquiryIdCaption" runat="server"></asp:Label></h1>
<h2 id="AccessMessage" runat="server" visible="false">You do not have access to this enquiry!</h2>
<ul id="EnquiryActionsMenu" class="menu-horizontal menu-actions">
    <li id="CloseItem" runat="server"><asp:HyperLink ID="CloseLink" runat="server" Text="Close Enquiry" CssClass="button"></asp:HyperLink></li>
    <li id="ReferItem" runat="server"><asp:HyperLink ID="ReferLink" runat="server" Text="Refer Enquiry" CssClass="button"></asp:HyperLink></li>
    <li><asp:HyperLink ID="EditEnquiryLink" runat="server" Text="Edit Enquiry" CssClass="button"></asp:HyperLink></li>
    <li><asp:HyperLink ID="AddCommentLink" runat="server" Text="Add Comment" CssClass="button"></asp:HyperLink></li>
    <li><asp:HyperLink ID="AddDocumentLink" runat="server" Text="Add Document" CssClass="button"></asp:HyperLink></li>
    <li><asp:HyperLink ID="AddAvoidableLink" runat="server" Text="Add Avoidable" CssClass="button"></asp:HyperLink></li>
    <li id="DeleteItem" runat="server"><asp:HyperLink ID="DeleteLink" runat="server" Text="Delete Enquiry" CssClass="button"></asp:HyperLink></li>
</ul>
<ul id="CustomerActionsMenu" class="menu-horizontal menu-actions">
    <li id="RemoveCustomerItem" runat="server"><asp:hyperlink ID="RemoveCustomerLink" runat="server" Text="Remove Customer (make anon)" CssClass="button"></asp:hyperlink></li>
    <li><asp:hyperlink ID="ChangeCustomerLink" runat="server" Text="Change Customer" CssClass="button"></asp:hyperlink></li>
    <li id="ViewCustomerHistoryItem" runat="server"><asp:HyperLink ID="ViewCustomerHistoryLink" runat="server" Text="View Customer History" CssClass="button"></asp:HyperLink></li>
    <li id="EmailCustomerItem" runat="server"><asp:HyperLink ID="EmailCustomer" runat="server" text="Email Customer" CssClass="button"></asp:HyperLink></li>
</ul>

<div class="tab-container">
    <ul class="menu-horizontal">
        <li><asp:HyperLink ID="DetailsLink" runat="server" Text="Details" CssClass="active"></asp:HyperLink></li>
        <li><asp:HyperLink ID="CustomerLink" runat="server" Text="Customer"></asp:HyperLink></li>
        <li><asp:HyperLink ID="HistoryLink" runat="server" Text="History"></asp:HyperLink></li>
        <li><asp:HyperLink ID="ReferralsLink" runat="server" Text="Referrals"></asp:HyperLink></li>
        <li><asp:HyperLink ID="CommentsLink" runat="server" Text="Comments"></asp:HyperLink></li>
        <li><asp:HyperLink ID="DocumentsLink" runat="server" Text="Documents"></asp:HyperLink></li>
        <li><asp:HyperLink ID="Commitmentslink" runat="server" Text="Commitment"></asp:HyperLink></li>
        <li><asp:HyperLink ID="ShowAllLink" runat="server" Text="Show All"></asp:HyperLink></li>        
    </ul>

    <div id="Details">
        <h2>Main Details</h2>
        <dl>
            <dt>Source:</dt>
            <dd>
                <asp:PlaceHolder ID="EnquirySource" runat="server"></asp:PlaceHolder>
            </dd>
            <dt>Press/Media?:</dt>
            <dd><asp:CheckBox ID="IsMediaCustomer" runat="server" ToolTip="media related enquiry" Enabled="false" /></dd>
            <dt>Confidential?:</dt>
            <dd><asp:CheckBox ID="Confidential" runat="server" ToolTip="Confidential Enquiry restricted to staff it has been referred to." Enabled="false"></asp:CheckBox></dd>
            <dt>Classification:</dt>
            <dd><asp:literal ID="Classification" runat="server"></asp:literal></dd>
            <dt>Receipt:</dt>
            <dd><asp:literal ID="Receipt" runat="server"></asp:literal></dd>
            <dt>Enquiry:</dt>
            <dd class="enqdetail"><asp:literal ID="EnquiryDetail" runat="server"></asp:literal></dd>
            <asp:PlaceHolder ID="EnquiryResponseRow" runat="server">
            <dt>Response:</dt>
            <dd><asp:literal ID="EnquiryResponse" runat="server"></asp:literal></dd>
            </asp:PlaceHolder>
            <dt>Deadline:</dt>
            <dd><asp:literal ID="Deadline" runat="server"></asp:literal></dd>
            <dt>Avoidables:</dt>
            <dd><asp:literal ID="Avoidables" runat="server"></asp:literal></dd>
            <dt>Tags:</dt>
            <dd>
                <asp:literal ID="Tags" runat="server"></asp:literal>
                <asp:HyperLink ID="ManageTagsLink" runat="server" Text="Manage Tags"></asp:HyperLink>
            </dd>
        </dl>
    </div>

    <div id="Customer">
        <h2>Customer Details</h2>
        <dl>
            <dt><asp:literal ID="CustomerDetailsCaption" runat="server" Text="Name:"></asp:literal></dt>
            <dd><asp:literal ID="CustomerDetails" runat="server"></asp:literal></dd>
            <dt>Address 1:</dt>
            <dd><asp:literal ID="Address1" runat="server"></asp:literal></dd>  
            <dt>Address 2:</dt>
            <dd><asp:literal ID="Address2" runat="server"></asp:literal></dd>  
            <dt>Address 3:</dt>
            <dd><asp:literal ID="Address3" runat="server"></asp:literal></dd>  
            <dt>Address 4:</dt>
            <dd><asp:literal ID="Address4" runat="server"></asp:literal></dd>  
            <dt>Address 5:</dt>
            <dd><asp:literal ID="Address5" runat="server"></asp:literal></dd>
            <dt>Email:</dt>
            <dd><asp:hyperlink ID="CustomerEmail" runat="server"></asp:hyperlink></dd>  
            <dt>Phone:</dt>
            <dd><asp:literal ID="CustomerPhone" runat="server"></asp:literal></dd>  
            <dt>Fax:</dt>
            <dd><asp:literal ID="CustomerFax" runat="server"></asp:literal></dd>
            <asp:PlaceHolder ID="RepRow" runat="server">
            <dt>Rep:</dt>
            <dd><asp:literal ID="Rep" runat="server"></asp:literal></dd>
            </asp:PlaceHolder>                      
        </dl>
    </div>

    <div id="History">
        <h2>Enquiry History</h2>
        <asp:Repeater ID="HistoryList" runat="server">
            <HeaderTemplate>
                <table>
                    <thead>
                        <tr>
                            <th id="Status">Status</th>
                            <th id="Date">Date</th>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                        <tr>
                            <td headers="Status"><%#Eval("EventDetail")%></td>
                            <td headers="Date"><%#Eval("EventDate", "{0:dd/MM/yyyy HH:mm}")%></td>
                        </tr>
            </ItemTemplate>
            <FooterTemplate>
                    </tbody>
                </table>            
            </FooterTemplate>
        </asp:Repeater>
    </div>

    <div id="Referrals">
        <h2>Referrals</h2>
        <asp:Repeater ID="EnquiryReferrals" runat="server">
            <HeaderTemplate>
                <table>
                    <thead>
                        <tr>
                            <th id="Referred">Referred to</th>
                            <th id="Date">Date</th>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                        <tr>
                            <td headers="Referred"><%#Eval("ReferredTo.DisplayName")%></td>
                            <td headers="Date"><%#Eval("DateReferred", "{0:dd/MM/yyyy HH:mm}")%></td>
                        </tr>
            </ItemTemplate>
            <FooterTemplate>
                    </tbody>
                </table>
            </FooterTemplate>
        </asp:Repeater>        
    </div>

    <div id="Comments">
        <h2>Comments</h2>
        <asp:Repeater ID="EnquiryComments" runat="server" OnItemDataBound="EnquiryCommentsItemDataBound">
            <HeaderTemplate>
                <table>
                    <thead>
                        <tr>
                            <th id="AddedBy" class="small">Added By</th>
                            <th id="Comment">Comment</th>
                            <th id="SentFys" class="small">Sent to Fix Your Street?</th>
                            <th id="Options" class="small">Options</th>
                        </tr>
                    </thead>
                    <tbody>                    
            </HeaderTemplate>
            <ItemTemplate>
                        <tr>
                            <td headers="AddedBy"><%#Eval("AddedBy.DisplayName")%><br />on <%#Eval("CommentDate", "{0:dd/MM/yyyy HH:mm}")%></td>
                            <td headers="Comment" class="medium"><%#Eval("Comment").ToString().Linkify()%></td>
                            <td headers="SentFys"><asp:Literal ID="SentToFixYourStreet" runat="server"></asp:Literal></td>
                            <td headers="Options">
                                <asp:HyperLink ID="EditCommentLink" runat="server" Text="Edit"></asp:HyperLink>
                                <asp:HyperLink ID="DeleteCommentLink" runat="server" Text="Delete"></asp:HyperLink>
                            </td>
                        </tr>
            </ItemTemplate>
            <FooterTemplate>
                    </tbody>
                </table>
            </FooterTemplate>
        </asp:Repeater>       
    </div>

    <div id="Documents">
        <h2>Documents</h2>
        <asp:Repeater ID="EnquiryDocuments" runat="server" OnItemDataBound="EnquiryDocumentsItemDataBound">
            <HeaderTemplate>
                <table>
                    <thead>
                        <th id="Added" class="small">Added by</th>
                        <th id="File">File</th>
                        <th id="Options" class="small">Options</th>
                    </thead>
                    <tbody>                        
            </HeaderTemplate>
            <ItemTemplate>
                        <tr>
                            <td>
                                <%#Eval("AddedBy.DisplayName")%><br />
                                on <%#Eval("DateAdded", "{0:dd/MM/yyyy HH:mm}")%>
                            </td>
                            <td>
                                <asp:HyperLink ID="FileLink" runat="server"></asp:HyperLink>
                                <asp:Literal ID="FileDescription" runat="server"></asp:Literal>
                            </td>
                            <td>
                                <asp:HyperLink ID="EditDocumentLink" runat="server" Text="Edit"></asp:HyperLink>
                                <asp:HyperLink ID="DeleteDocumentLink" runat="server" Text="Delete"></asp:HyperLink>
                            </td>
                        </tr>
            </ItemTemplate>
            <FooterTemplate>
                    </tbody>
                </table>
            </FooterTemplate>
        </asp:Repeater>       
    </div>

    <div id="Commitment">
        <h2>Commitment</h2>
        <p class="info">To complete a commitment add a comment to the enquiry detailing the completion and tick the "Complete Commitment" box.</p>
        <dl>        
            <dt>Status</dt>
            <dd><asp:literal ID="CommitmentStatus" runat="server"></asp:literal></dd>
            <dt>Added By:</dt>
            <dd><asp:literal ID="CommitmentAddedBy" runat="server"></asp:literal></dd>
            <dt>Added On:</dt>
            <dd><asp:literal ID="CommitmentAddedOn" runat="server"></asp:literal></dd>
            <dt>Assigned to:</dt>
            <dd><asp:literal ID="CommitmentAssignedTo" runat="server"></asp:literal></dd>
            <dt>Commitment:</dt>
            <dd><asp:literal ID="CommitmentDetail" runat="server"></asp:literal></dd>
            <dt>Deadline:</dt>
            <dd><asp:literal ID="CommitmentDeadline" runat="server"></asp:literal></dd>
            <dt>Approved by:</dt>
            <dd><asp:literal ID="CommitmentApprovedBy" runat="server"></asp:literal></dd>
            <dt>Date Approved:</dt>
            <dd><asp:literal ID="CommitmentDateApproved" runat="server"></asp:literal></dd>
        </dl>    
    </div>
</div>
</asp:Content>
